package com.example.shiyansan.mapper;

import com.example.shiyansan.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface UserMapper {

    @Select("select * from user where username = #{username}")
    User findByUsername(String username);

    @Insert("insert into user( username, password, email) VALUES (#{username},#{password},#{email})")
    void insertUser(User user);

    @Select("select username from  user where user_id = #{userId}")
    String findByUserId(Long userId);
}
